import machine
import utime

R = machine.PWM("GP0")
R.freq(100)

while True:
    for x in range(1,100,5):
        R.duty_u16(x)
        utime.sleep_ms(100)

    for x in range(100,0,-5):
        R.duty_u16(x)
        utime.sleep_ms(100)